<?php
$this->lang->load('template');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0048)http://www.fav365.com/ball/?m=admin&c=good&a=add -->
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK 
href="/css/admin.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<STYLE type=text/css>
.STYLE1 {
	COLOR: #ff0000
}
</STYLE>
</HEAD>
<BODY>
<DIV class=admin_box>
  <DIV class=admin_boxtop></DIV>
  <DIV class=admin_boxmain>
<?php
	include(dirname(BASEPATH)."/spaw2/spaw.inc.php");
	$spaw1 = new SpawEditor("content",$result['content']);
	$url = site_url('categories/index?template=options&selected='.$result['cat_id']);
	$options = file_get_contents($url);
?>
    <?=form_open('articles/save','enctype="multipart/form-data"');?>
    <input type="hidden" value="<?=intval($result['id'])?>" name="id" />
    <input type="hidden" name="redirect" value="<?=site_url('articles/admin')?>" />
    <TABLE cellSpacing=0 cellPadding=0 width="96%" align=center border=0>
      <TBODY>
        <TR>
          <TD><H1 class=title>
     		  <?php if(!isset($result)):?>
              <?=$this->lang->line('tpl_act_add').$this->lang->line('tpl_article')?>
              <input type="hidden" name="userfile" value="<?=$result['file_url']?>" />
              <?php else:?>
              <?=$this->lang->line('tpl_act_edit').$this->lang->line('tpl_article')?>-
              <?=$result['title']?>
              <?php endif;?>
            </H1></TD>
        </TR>
      </TBODY>
    </TABLE>
    <TABLE class=table cellSpacing=1 cellPadding=5 width="96%" align=center 
border=0>
      <TBODY>
        <TR>
          <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_title')?></DIV></TD>
          <TD><INPUT class=inputstyle name="title" value="<?=$result['title']?>">
            <SPAN class=STYLE1>*
			<?=sprintf($this->lang->line('required'),$this->lang->line('tpl_title'))?>
            <?=sprintf($this->lang->line('required_length'),'',3,100)?>
			</SPAN></TD>
        </TR>
      <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_cates')?></DIV></TD>
        <TD><SELECT class=inputstyle name="cat_id">
            <?=$options?>
          </SELECT>
          <SPAN class=STYLE1>*<?=sprintf($this->lang->line('required'),$this->lang->line('tpl_cates'))?></SPAN> </TD>
      </TR>
      <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_article_type');?></DIV></TD>
        <TD><input name="article_type" value="0" checked="checked" type="radio">
          <?=$this->lang->line('tpl_article_type_normal');?>
          <input name="article_type" value="1" type="radio"<?php if ($result['article_type']==1):?> checked="checked"<?php endif;?>>
          <?=$this->lang->line('tpl_article_type_top');?> <SPAN class=STYLE1>*</SPAN> </TD>
      </TR>
      <TR>
        <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_yes')?><?=$this->lang->line('tpl_no')?><?=$this->lang->line('tpl_ishow')?></DIV></TD>
        <TD><select name="is_open">
		 	<option value="1"<?php if($result['is_open']==1):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_yes')?></option>
            <option value="0"<?php if(isset($result)&&$result['is_open']==0):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_no')?></option>
          </select>
        </TD>
      </TR>
      <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_author');?></DIV></TD>
        <TD><INPUT class=inputstyle name="author" value="<?=$result['author']?>">
        </TD>
      </TR>
      <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_author');?>Email</DIV></TD>
        <TD><INPUT class=inputstyle name="author_email" value="<?=$result['author_email']?>">
        </TD>
      </TR>
      <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_keyword');?></DIV></TD>
        <TD><INPUT class=inputstyle name="keywords" value="<?=$result['keywords']?>">
        </TD>
      </TR>
      <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_link');?></DIV></TD>
        <TD><INPUT class=inputstyle name="link" value="<?=$result['link']?>">
        </TD>
      </TR>
	  <TR>
        <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_template')?></DIV></TD>
        <TD><INPUT class=inputstyle name="tpls" value="<?=$result['tpls']?>">
        </TD>
      </TR>
      <tr>
        <td class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_upload')?></DIV></td>
        <td><input type="file" class="inputstyle" name="userfile">
          <br />
          <span class="narrow-label"> OR <?=$this->lang->line('tpl_url')?>
          <input name="file_url" class="inputstyle" type="text" value="<?=$result['file_url']?>" size="30" maxlength="255" />
          </span></td>
      </tr>
      <tr>
        <td class="tdbg bold"><DIV align=right>
        <?=$this->lang->line('tpl_content')?>
        </DIV></td>
        <td>
        	<?php
				$spaw1->show();
			?>
		 <SPAN class='STYLE1'>*
         <?=sprintf($this->lang->line('min_length'),$this->lang->line('tpl_content'),5)?>
         </SPAN> 
        </td>
      </tr>
      <TR>
        <TD colSpan=2><DIV align=center>
            <INPUT class=btn type=submit value="<?=$this->lang->line('tpl_submit');?>" name=Submit>
            <INPUT class=btn onclick=history.back(-1) type=button value="<?=$this->lang->line('tpl_returnback');?>">
          </DIV></TD>
      </TR>
      </TBODY>
    </TABLE>
    </FORM>
  </DIV>
  <DIV class=admin_boxbottom></DIV>
</DIV>
</BODY>
</HTML>
